<!DOCTYPE html>
<html>
<head>

<title>首页</title>
</head>
<body>
	<form id="form">
		姓名：<input type="text" name="name" value="小明"><br> 密码：<input
			type="password" name="password"><br>
		<button type="button" id="submit">登录</button>
	</form>

	<script type="text/javascript">
		$(function() {

			$('#submit').on(
					'click',
					function() {
						$.post('${ctxPath}/login', $('#form').serialize(),
								function(json) {
									if (json.code == 200) {
										location.href = '${ctxPath}/index';
									} else {
										$.alert(json.message);
									}
								})
					})

		})
	</script>
</body>
</html>